package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TUserMoneyChangeMapper;
import com.ruoyi.system.domain.TUserMoneyChange;
import com.ruoyi.system.service.ITUserMoneyChangeService;

/**
 * 用户资金变动Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-16
 */
@Service
public class TUserMoneyChangeServiceImpl implements ITUserMoneyChangeService 
{
    @Autowired
    private TUserMoneyChangeMapper tUserMoneyChangeMapper;

    /**
     * 查询用户资金变动
     * 
     * @param id 用户资金变动主键
     * @return 用户资金变动
     */
    @Override
    public TUserMoneyChange selectTUserMoneyChangeById(Long id)
    {
        return tUserMoneyChangeMapper.selectTUserMoneyChangeById(id);
    }

    /**
     * 查询用户资金变动列表
     * 
     * @param tUserMoneyChange 用户资金变动
     * @return 用户资金变动
     */
    @Override
    public List<TUserMoneyChange> selectTUserMoneyChangeList(TUserMoneyChange tUserMoneyChange)
    {
        return tUserMoneyChangeMapper.selectTUserMoneyChangeList(tUserMoneyChange);
    }

    /**
     * 新增用户资金变动
     * 
     * @param tUserMoneyChange 用户资金变动
     * @return 结果
     */
    @Override
    public int insertTUserMoneyChange(TUserMoneyChange tUserMoneyChange)
    {
        tUserMoneyChange.setCreateTime(DateUtils.getNowDate());
        return tUserMoneyChangeMapper.insertTUserMoneyChange(tUserMoneyChange);
    }

    /**
     * 修改用户资金变动
     * 
     * @param tUserMoneyChange 用户资金变动
     * @return 结果
     */
    @Override
    public int updateTUserMoneyChange(TUserMoneyChange tUserMoneyChange)
    {
        tUserMoneyChange.setUpdateTime(DateUtils.getNowDate());
        return tUserMoneyChangeMapper.updateTUserMoneyChange(tUserMoneyChange);
    }

    /**
     * 批量删除用户资金变动
     * 
     * @param ids 需要删除的用户资金变动主键
     * @return 结果
     */
    @Override
    public int deleteTUserMoneyChangeByIds(Long[] ids)
    {
        return tUserMoneyChangeMapper.deleteTUserMoneyChangeByIds(ids);
    }

    /**
     * 删除用户资金变动信息
     * 
     * @param id 用户资金变动主键
     * @return 结果
     */
    @Override
    public int deleteTUserMoneyChangeById(Long id)
    {
        return tUserMoneyChangeMapper.deleteTUserMoneyChangeById(id);
    }
}
